@use 'sass:list';
@use '../uni.scss';

$text-sizes: (
  xxs: (
    uni.$uni-font-size-xxs,
    uni.$uni-font-size-xxs + 8rpx
  ),
  xs: (
    uni.$uni-font-size-xs,
    uni.$uni-font-size-xs + 8rpx
  ),
  sm: (
    uni.$uni-font-size-sm,
    uni.$uni-font-size-sm + 10rpx
  ),
  base: (
    uni.$uni-font-size-base,
    uni.$uni-font-size-base + 12rpx
  ),
  lg: (
    uni.$uni-font-size-lg,
    uni.$uni-font-size-lg + 12rpx
  ),
  xl: (
    uni.$uni-font-size-xl,
    uni.$uni-font-size-xl + 14rpx
  ),
  xxl: (
    uni.$uni-font-size-xxl,
    uni.$uni-font-size-xxl + 20rpx
  )
);

@each $key, $value in $text-sizes {
  .text-#{$key} {
    font-size: list.nth($value, 1);
    line-height: list.nth($value, 2);
  }
}

.text-primary {
  color: uni.$uni-text-color;
}

.text-secondary {
  color: uni.$uni-text-color-secondary;
}

.text-third {
  color: uni.$uni-text-color-third;
}

.text-fourth {
  color: uni.$uni-text-color-fourth;
}

.text-placeholder {
  color: uni.$uni-text-color-placeholder;
}

.text-red {
  color: #d13820;
}

.text-green {
  color: #269c74;
}

.text-blue {
  color: #006ff6;
}

.text-white {
  color: #fff;
}

.text-gray-800 {
  color: #8c8c8c;
}

.line-through {
  text-decoration-line: line-through;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

$font-weights: (
  normal: 400,
  medium: 500,
  semibold: 600,
  bold: 700
);

@each $k, $v in $font-weights {
  .font-#{$k} {
    font-weight: $v;
  }
}

.leading {
  line-height: uni.$uni-leading-base;
}

.leading-lg {
  line-height: uni.$uni-leading-lg;
}

.leading-xl {
  line-height: uni.$uni-leading-xl;
}

.leading-2xl {
  line-height: uni.$uni-leading-2xl;
}

.leading-3xl {
  line-height: uni.$uni-leading-3xl;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.text-brown {
  color: #763e18;
}

.nowrap {
  white-space: nowrap;
}

.text-orange {
  color: #ff5322;
}
